<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //省略掉 new Promise
        new Promise((resolve,reject) => {
            setTimeout(() => {
                resolve('A')
            },1000)
        }).then(res => {
            console.log(res)
            //return Promise.reject('error message') //调用reject后,不会继续向下执行,直接调用catch
            throw 'error message'
        }).then(res => {
            console.log(res)
            return Promise.resolve(res + 'C')
        }).then(res => {
            console.log(res)
        }).catch(err => {
            console.log(err)
        })
        
        //省略掉Promise.resolve()
        new Promise((resolve,reject) => {
            setTimeout(() => {
                resolve('A')
            },1000)
        }).then(res => {
            console.log(res)
            return res + 'B'
        }).then(res => {
            console.log(res)
            return res + 'C'
        }).then(res => {
            console.log(res)
        })
    </script>
</body>
</html>